package com.string;

public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();
        System.out.println(stringBuilder.append("12314").append("7654").reverse());
        System.out.println(stringBuilder.toString());


        int[] arr = {1,2,3,4};
        StringBuilder res = new StringBuilder();
        res.append("[");
        for(int i=0;i<arr.length;i++){
            if(i==arr.length-1){
                res.append(arr[i]).append("]");
            }else{
                res.append(arr[i]).append(",");
            }
        }

        System.out.println(res.toString());
    }
}
